package JDBCUI;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class Rewardmanage extends  JFrame {






    public Rewardmanage() {



        // 可以发现按钮和文本框都已经有了变化，给窗口润色不少。
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        }catch(Exception e) {
            System.out.println(e);
        }



        //创建顶层容器



        //创建按钮组件
        JButton buttonreturn = new JButton("返回主界面");
        JButton button1 = new JButton("教师奖惩关系管理");
        JButton button2 = new JButton("奖惩信息管理");

        //流布局 左对齐，间距
        // FlowLayout flow = new FlowLayout(FlowLayout.LEFT,50,50);
        //创建中间容器
        //  JPanel panel = new JPanel(flow);
        //将负责放置控件的面板设置成透明
        // panel.setOpaque(false);

        JPanel jpforbutton = new JPanel(new GridLayout(1,2));
        //设置大小
        jpforbutton.setSize(500,400);
        //设置背景颜色
        jpforbutton.setBackground(Color.LIGHT_GRAY);

        jpforbutton.add(button1);
        jpforbutton.add(button2);

        jpforbutton.add(buttonreturn);

        //将中间容器放在窗口中





        button1.addActionListener(new ActionListener(){

            public void actionPerformed(ActionEvent e){
                Huode huode = new Huode();
            }
        });
        button2.addActionListener(new ActionListener(){
            public void actionPerformed(ActionEvent e){
                Staff staff =new Staff();
            }
        });



        buttonreturn.addActionListener(new ActionListener(){

            public void actionPerformed(ActionEvent e){
                dispose();
            }

        });


        this.setTitle("管理奖惩信息");
        this.setLayout(new GridLayout(9,1));
        //显示窗口
        this.add(jpforbutton);
        this.setLocation(800,350);
        this.setSize(600,500);
        this.setVisible(true);
    }


}





